<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <script src="js/jquery.min.js"></script>
  <link rel="stylesheet" href="js/layui/css/layui.css">
  <script src="js/layui/layui.js"></script>
</head>
<script type="text/html" id="toolbarDemo">
  <a class="layui-btn layui-btn-sm" lay-event="detail">增加</a>
</script>
<script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script type="text/html" id="titleTpl">
  {{#  if(d.notice_administratorId != null){ }}
  <a href="">{{d.administrators.user_username}}</a>
  {{#  } else { }}
  {{#  } }}
</script>

<body>
<div>
  <table class="layui-table" lay-data="{ id:'test'}" lay-filter="test">
    <thead>
    <tr>
      <th lay-data="{field:'notice_id', sort: true}">公告编号</th>
      <th lay-data="{field:'users',templet: '#titleTpl'}">公告发布者
      <th lay-data="{field:'notice_title'}">公告标题</th>
      <th lay-data="{field:'notice_content'}">公告内容</th>
      <th lay-data="{field:'notice_startTime'}">公告开始时间</th>
      <th lay-data="{field:'notice_endTime'}">公告失效时间</th>
      <th lay-data="{fixed: 'right', align:'center', toolbar: '#barDemo'}">功能</th>
    </tr>
    </thead>
  </table>

</div>
<div style="display: none; " id="detail">
  <form class="layui-form" lay-filter="formTest" id="addGoodsForm">
    <div class="layui-form-item" style="display: none">
      <label class="layui-form-label">公告编号</label>
      <div class="layui-input-inline">
        <input type="text" name="notice_id" placeholder="请输入标题" autocomplete="off"
               class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">开始时间</label>
      <div class="layui-input-inline">
        <input type="text" name="notice_startTime" id="startt" required lay-verify="required" placeholder="请输入公告开始时间"
               class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">失效时间</label>
      <div class="layui-input-inline">
        <input type="text" name="notice_endTime" id="endt" required lay-verify="required" placeholder="请输入失效时间"
               class="layui-input">
      </div>
    </div>
    <div class="layui-form-item" style="display: none">
      <label class="layui-form-label">公告发布者</label>
      <div class="layui-input-inline">
        <input type="text" name="notice_administratorId" value="1" placeholder="请输入标题" autocomplete="off"
               class="layui-input">
        </select>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">公告标题</label>
      <div class="layui-input-inline">
        <input type="text" name="notice_title" required lay-verify="required" placeholder="请输入公告标题" autocomplete="off"
               class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">公告内容</label>
      <div class="layui-input-inline">
        <textarea name="notice_content"  placeholder="请输入内容" class="layui-textarea"></textarea>
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-input-block">
        <button class="layui-btn" id="formDemo" lay-submit lay-filter="formDemo">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
      </div>
    </div>
  </form>
</div>

</body>
<script src="js/loginjs/cunchu.js"></script>
<script src="js/notice.js" type="text/javascript"></script>
</html>
